package models;

import java.util.Timer;
import java.util.TimerTask;

public class WUIFPSTimer extends Timer {

	private final static long FPS_TIME = 400;
    private final iRefreshPrinter irp;
    public TimerTask timerTask;

    public WUIFPSTimer(iRefreshPrinter irp) {
        this.irp = irp;
	}

	public void start() {
        timerTask = new TimerTask(){

            @Override
            public void run() {
                irp.print();
            }
        };
		schedule(timerTask, 0, FPS_TIME);
	}

    public interface iRefreshPrinter{
        public void print();
    }
}
